from nebula_api_v3 import NebulaAPI
import pandas as pd
from nebula_data_engine.nebula_data_engine import NebulaDataEngine



if __name__ == "__main__":
    # 一个不存在的excel
    excel_file = "users.xlsx"
    nde = NebulaDataEngine(excel_file)
    nde.save({"name": "Alice", "age": 24, "city": "New York"},table_name="test")
    # 初始化 NebulaAPI，传入 Excel 文件路径
    api = NebulaAPI(data_source=nde, enable_docs=True, enable_crud=True)
    # 启动服务器
    print(f"启动 NebulaAPI 服务器，访问 http://localhost:5000/api/docs 查看 Swagger 文档。")
    api.run_server(host='localhost', port=5000)